if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[GetCertificationContent]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[GetCertificationContent]
GO
SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO
/***************************************************************************
* Name:				GetCertificationContent

* Purpose:			This Stored Procedure retrieves the saved serializedxml content from 
				the temporary table to create the PDF								
* PARAMETERS
* Name				Description					
* -------------			-----------------------------------------------------------
* @executionId int,		ExecutionId with respect to WorkFlow
* @fwkDomainUserId int,		FrameworkDomainUserId of the user accepting the 
				participation through workflow
* @activityName varchar(200)	WorkFlow Activity name (work flow which initiated the procedure)  

* Returns
* ---------

* A row containing the serialized content and the liscence file path
*
***************************************************************************/
CREATE Procedure dbo.[GetCertificationContent]
(  
@executionId int,  
@fwkDomainUserId int,  
@activityName varchar(200)  
)  
As   
BEGIN  
	Select 
		SerializedContent,
		ServerMapPath 
	from WorkFlow_certified_content   
    where   
     ExecutionId=@executionId and  
     fwkDomainUserId = @fwkDomainUserId and   
     ActivityName = @activityName   
END
